﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace WinFormDataBinding
{
    class TextBoxWriter : TextWriter
    {
        private TextBox destTextBox;

        public TextBoxWriter(TextBox destTextBox)
        {
            this.destTextBox = destTextBox;
        }

        public override Encoding Encoding
        {
            get { return Encoding.UTF8; }
        }

        public override void Write(char value)
        {
            destTextBox.AppendText(value.ToString());
        }
    }
}
